<!--管理员=》用户黑名单-->
<template>
	<div>
	  <MainContent>
		 <div class="content_title">
		 	<span style="color: #222222;font-size: 24px;font-weight: 400;">{{title}}</span>
<!-- 		 	<button class="el-button mini addBuss" @click="lookUserDown"> 黑名单</button> -->		 
</div>
		 <div class="table_content">
		 	<el-row>
			   <p>用户退出任务时间</p>
			   
			   				<el-input
			   	placeholder="请输入买家无责退出时间(X分钟)"
			   	style="width:320px;"
			   	v-model="MissionExitTime">
				<template slot="append">分钟</template>
			   </el-input>
				<p>积分时效</p>
								<el-input
					placeholder="请输入买家积分时效(X天)"
					style="width:320px;"
					v-model="ScoreValidity">
				<template slot="append">天</template>
				</el-input>
				<p>金币时效</p>
				   				<el-input
				   	placeholder="请输入卖家金币时效(X天)"
				   	style="width:320px;"
				   	v-model="GoldValidity">
				   	<template slot="append">天</template>
				   </el-input>
				   
			   </el-row>
			   <br />
			   <el-row>
				 <el-button type="primary" @click="Save">保存</el-button>  
				</el-row>
				<br />
				<br />
				<br />
				<br />
				<br />
				<br />
				<br />
				<br />
		 </div>
		 
		 
      </MainContent>
   </div>
</template>
<script>
	import MainContent from '../components/main_content'
	import global from './global'
	export default {
    name: "Settings",
    inject:['reload'],
    mounted(){
    	this.initData();
    },
    data() {
    	return {
    		title: '设置',
    		MissionExitTime: '',
    		ScoreValidity: '',
			GoldValidity:""
    	}
    },
    components:{
    	MainContent
    },
    methods:{
    	initData(){
    		let _this = this;
    		global.$http({
						method:'get',
						url:global.urlAll+'ShowSystem/',
						headers:{
							'Content-Type':'application/x-www-form-urlencoded',
							'cache-control': 'no-cache, no-store',
							'Pragma': 'no-cache'
						},
					}).then((res)=>{
						console.log(res)
						if(res.data.Success == 'true'){
							_this.MissionExitTime = res.data.NoLiable
							_this.ScoreValidity = res.data.Score
							_this.GoldValidity = res.data.Gold
						}else{
							_this.$message("加载失败，请刷新重试")
						}
					})
    	},
    	Save(){
			let _this = this;
			this.$confirm('是否确认保存?', '提示', {
		         confirmButtonText: '确定',
		         cancelButtonText: '取消',
		         type: 'warning'
		       }).then(() => {
				global.$http({
						method:'get',
						url:global.urlAll+'UpdateSystem/',
						headers:{
							'Content-Type':'application/x-www-form-urlencoded',
							'cache-control': 'no-cache, no-store',
							'Pragma': 'no-cache'
						},
						params:{
							NoLiable: _this.MissionExitTime,
							Score:_this.ScoreValidity,
							Gold:_this.GoldValidity
						}
					}).then((res)=>{
						console.log(res)
						if(res.data.Success == 'true'){
							_this.$message('保存成功');
							_this.initData();
							
						}else{
							_this.$message("保存失败，请重试")
						}
					})				
    	       })
        }
   }
	
}
</script>

<style scoped="scoped">
	.content_title {
	padding-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    
  }
  .addBuss{
  	width: 150px;
  	height: 40px;
  	background: #1989FA;
  	color: #FFFFFF;
    font-weight: bold;
  }
  .table_content{
  	padding: 20px;
  	background: #FFFFFF;
  }
  table,tbody,thead {
	  width: 100% !important;
	}
	colgroup {
	  position: absolute;
	  width: 100% !important;
	  display: flex;
	}
	col {
	  flex: 1;
	  text-align: center;
	}
</style>
